/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.fallback.trade;

import com.enation.app.javashop.core.client.feignimpl.trade.OrderCenterClientFeignImpl;
import com.enation.app.javashop.core.handler.BaseFallbackFactory;
import com.enation.app.javashop.model.trade.order.dto.OrderDTO;
import com.enation.app.javashop.model.trade.order.vo.OrderParam;
import com.enation.app.javashop.model.trade.order.vo.TradeParam;
import com.enation.app.javashop.model.trade.order.vo.TradeVO;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Service;

/**
 * 交易中心断路器
 */
@Service
public class OrderCenterClientFallbackFactory extends BaseFallbackFactory<OrderCenterClientFeignImpl> implements FallbackFactory {


    @Override
    protected OrderCenterClientFeignImpl fallback() {
        return new OrderCenterClientFallback();
    }

    /**
     * 交易中心断路器
     */
    @Service
    public static class OrderCenterClientFallback implements OrderCenterClientFeignImpl {

        protected final Log logger = LogFactory.getLog(this.getClass());


        @Override
        public OrderDTO createOrderDTO(OrderParam orderParam) {
            logger.debug("创建订单对象失败");
            return null;
        }

        @Override
        public TradeVO createTradeVO(TradeParam tradeParam) {
            logger.debug("createTradeVO失败");
            return null;
        }

        @Override
        public void createTrade(TradeVO tradeVO) {

            logger.debug("createTrade失败");

        }
    }
}
